package com.cheng.cms.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.SimpleDateFormat;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Repair {
    private String buildingNo;
    private String roomNo;
    private String details;
    private Date applicationDate;
    private Date repairDate;
    private String whetherFromBalance;
    private String repairMen;
    private String money;

    public String getApplicationDate(){
        Date currentTime = applicationDate;
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        String dateString = formatter.format(currentTime);
        return dateString;
    }

    public String getRepairDate(){
        if(repairDate == null){
            return "无";
        }
        Date currentTime = repairDate;
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        String dateString = formatter.format(currentTime);
        return dateString;
    }

    public String getRepairMen(){
        return repairMen==null?"无":repairMen;
    }

    public String getMoney(){
        return money==null?"无":money;
    }

}
